#include <stdio.h>

int ret(int n){
	int ret = 1;
	for(int i = 1;i<=n;i++){
		ret *= i;
	}
	return ret;
}

int main()
{
	int xh = 0;
	int result = 0;
	scanf("%d", &xh);
	for(int k = 0;k<xh;k++){
		result += ret(k+1);
	}
	printf("%d", result);
}